extends StaticBody2D
class_name cube_door_16x16

var active_texture

var allow_open: bool = true
#func _ready():
#	GlobalVar.door_list.push_back(door_name)
#	print(GlobalVar.door_list)

func _process(_delta):
	if GlobalVar.exit_door_open:
		#GlobalVar.exit_door_open = false
		pop()
## door open animation function
func pop():
	$Sprite2D.texture = active_texture
	if allow_open:
		allow_open = false
		$Timer.start()


func _on_timer_timeout():
	queue_free()
	allow_open = true
